package com.kmproject.haifu.mvp.model.entity.beans;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

public class HomeNewsBean implements Parcelable {

    /**
     * commentCount : 0
     * createTime :
     * headlineContent :
     * headlineId : 0
     * headlineTitle :
     * headlineType : 0
     * images : [{"createTime":"","imageId":0,"imageOrder":0,"imageType":"","imageUrl":"","updateTime":""}]
     * isAdvertisement : 0
     * isDelete : 0
     * link :
     * publishTime :
     * updateTime :
     * userId : 0
     * viewCount :
     */

    private int commentCount;//评论数
    private String createTime;
    private String headlineContent;//内容
    private long headlineId;
    private String headlineTitle;
    private int headlineType;//0-无图，1-一张图片，3-三张图片，4-广告
    private int isAdvertisement;//是否是广告:0-否，1-是
    private int isDelete;//删除状态:0-未删除，1-已删除
    private String link;// 广告链接
    private String publishTime;
    private String updateTime;
    private long userId;
    private String viewCount;//浏览数
    private List<ImagesBean> images;

    protected HomeNewsBean(Parcel in) {
        commentCount = in.readInt();
        createTime = in.readString();
        headlineContent = in.readString();
        headlineId = in.readLong();
        headlineTitle = in.readString();
        headlineType = in.readInt();
        isAdvertisement = in.readInt();
        isDelete = in.readInt();
        link = in.readString();
        publishTime = in.readString();
        updateTime = in.readString();
        userId = in.readLong();
        viewCount = in.readString();
        images = in.createTypedArrayList(ImagesBean.CREATOR);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(commentCount);
        dest.writeString(createTime);
        dest.writeString(headlineContent);
        dest.writeLong(headlineId);
        dest.writeString(headlineTitle);
        dest.writeInt(headlineType);
        dest.writeInt(isAdvertisement);
        dest.writeInt(isDelete);
        dest.writeString(link);
        dest.writeString(publishTime);
        dest.writeString(updateTime);
        dest.writeLong(userId);
        dest.writeString(viewCount);
        dest.writeTypedList(images);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<HomeNewsBean> CREATOR = new Creator<HomeNewsBean>() {
        @Override
        public HomeNewsBean createFromParcel(Parcel in) {
            return new HomeNewsBean(in);
        }

        @Override
        public HomeNewsBean[] newArray(int size) {
            return new HomeNewsBean[size];
        }
    };

    public int getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(int commentCount) {
        this.commentCount = commentCount;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getHeadlineContent() {
        return headlineContent;
    }

    public void setHeadlineContent(String headlineContent) {
        this.headlineContent = headlineContent;
    }

    public long getHeadlineId() {
        return headlineId;
    }

    public void setHeadlineId(long headlineId) {
        this.headlineId = headlineId;
    }

    public String getHeadlineTitle() {
        return headlineTitle;
    }

    public void setHeadlineTitle(String headlineTitle) {
        this.headlineTitle = headlineTitle;
    }

    public int getHeadlineType() {
        return headlineType;
    }

    public void setHeadlineType(int headlineType) {
        this.headlineType = headlineType;
    }

    public int getIsAdvertisement() {
        return isAdvertisement;
    }

    public void setIsAdvertisement(int isAdvertisement) {
        this.isAdvertisement = isAdvertisement;
    }

    public int getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(int isDelete) {
        this.isDelete = isDelete;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(String publishTime) {
        this.publishTime = publishTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getViewCount() {
        return viewCount;
    }

    public void setViewCount(String viewCount) {
        this.viewCount = viewCount;
    }

    public List<ImagesBean> getImages() {
        return images;
    }

    public void setImages(List<ImagesBean> images) {
        this.images = images;
    }

    public static class ImagesBean implements Parcelable {
        /**
         * createTime :
         * imageId : 0
         * imageOrder : 0
         * imageType :
         * imageUrl :
         * updateTime :
         */

        private String createTime;
        private long imageId;
        private int imageOrder;
        private String imageType;
        private String imageUrl;
        private String updateTime;

        protected ImagesBean(Parcel in) {
            createTime = in.readString();
            imageId = in.readLong();
            imageOrder = in.readInt();
            imageType = in.readString();
            imageUrl = in.readString();
            updateTime = in.readString();
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(createTime);
            dest.writeLong(imageId);
            dest.writeInt(imageOrder);
            dest.writeString(imageType);
            dest.writeString(imageUrl);
            dest.writeString(updateTime);
        }

        @Override
        public int describeContents() {
            return 0;
        }

        public static final Creator<ImagesBean> CREATOR = new Creator<ImagesBean>() {
            @Override
            public ImagesBean createFromParcel(Parcel in) {
                return new ImagesBean(in);
            }

            @Override
            public ImagesBean[] newArray(int size) {
                return new ImagesBean[size];
            }
        };

        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public long getImageId() {
            return imageId;
        }

        public void setImageId(long imageId) {
            this.imageId = imageId;
        }

        public int getImageOrder() {
            return imageOrder;
        }

        public void setImageOrder(int imageOrder) {
            this.imageOrder = imageOrder;
        }

        public String getImageType() {
            return imageType;
        }

        public void setImageType(String imageType) {
            this.imageType = imageType;
        }

        public String getImageUrl() {
            return imageUrl;
        }

        public void setImageUrl(String imageUrl) {
            this.imageUrl = imageUrl;
        }

        public String getUpdateTime() {
            return updateTime;
        }

        public void setUpdateTime(String updateTime) {
            this.updateTime = updateTime;
        }
    }
}
